home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmNetwork
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Example 2: NetWork"
- ClientHeight = 3480
- ClientLeft = 1095
- ClientTop = 1785
- ClientWidth = 5325
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 3885
- Left = 1035
- LinkTopic = "Form2"
- MDIChild = -1 'True
- ScaleHeight = 3480
- ScaleWidth = 5325
- Tag = "2"
- Top = 1440
- Width = 5445
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 525
- Index = 0
- Left = 4650
- ScaleHeight = 495
- ScaleWidth = 555
- TabIndex = 3
- Top = 120
- Visible = 0 'False
- Width = 585
- End
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 525
- Index = 3
- Left = 4650
- Picture = "Network.frx":0000
- ScaleHeight = 495
- ScaleWidth = 555
- TabIndex = 2
- Top = 1740
- Visible = 0 'False
- Width = 585
- End
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 525
- Index = 2
- Left = 4650
- Picture = "Network.frx":0442
- ScaleHeight = 495
- ScaleWidth = 555
- TabIndex = 1
- Top = 1200
- Visible = 0 'False
- Width = 585
- End
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 525
- Index = 1
- Left = 4650
- Picture = "Network.frx":0884
- ScaleHeight = 495
- ScaleWidth = 540
- TabIndex = 0
- Top = 660
- Visible = 0 'False
- Width = 570
- End
- Begin AddFlowLib.AddFlow AddFlow1
- Height = 3075
- Left = 450
- TabIndex = 4
- Top = 420
- Width = 4065
- _Version = 65536
- _ExtentX = 7170
- _ExtentY = 5424
- _StockProps = 101
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Arial"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BorderStyle = 1
- ScrollBars = 3
- Shape = 0
- LinkStyle = 0
- Alignment = 7
- AutoSize = 0
- ArrowDst = 3
- ArrowOrg = 0
- DrawStyle = 0
- DrawWidth = 1,4013e-45
- ReadOnly = 0 'False
- MultiSel = -1 'True
- CanDrawNode = -1 'True
- CanDrawLink = -1 'True
- CanMoveNode = -1 'True
- CanSizeNode = -1 'True
- CanStretchLink = -1 'True
- CanMultiLink = -1 'True
- Transparent = 0 'False
- ShowGrid = 0 'False
- Hidden = 0 'False
- Rigid = 0 'False
- DisplayHandles = -1 'True
- AutoScroll = -1 'True
- xGrid = 7,00649e-45
- yGrid = 7,00649e-45
- xZoom = 100
- yZoom = 100
- FillColor = 16777215
- DrawColor = 0
- ForeColor = 0
- BackPicture = "Network.frx":0B8E
- End
- Attribute VB_Name = "frmNetwork"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub AddFlow1_DblClick()
- frmItemProp.Show 1
- End Sub
- Private Sub AddFlow1_KeyDown(KeyCode As Integer, Shift As Integer)
- Const KEY_DELETE = &H2E
- If KeyCode = KEY_DELETE Then
- AddFlow1.DeleteSel
- End If
- End Sub
- Private Sub AddFlow1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Me.SetFocus
- End Sub
- Private Sub Form_Activate()
- frmMain.ActivateForm
- End Sub
- Private Sub Form_Deactivate()
- frmMain.DeactivateForm
- End Sub
- Private Sub Form_Load()
- frmMain.ShowExample(1).Enabled = False
- Dim nodx As afNode, lnkx As afLink
- With AddFlow1
- .Left = 0
- .Top = 0
- ' Just to accelerate display (Don't forget to reset it at the end)
- .Repaint = False
- .DrawStyle = afInsideSolid
- .DrawColor = &H8000&
- .ArrowDst = 0
- ' Create nodes
- Set nodx = .Nodes.Add(4455, 180, 2685, 2955)
- nodx.ForeColor = 255
- nodx.DrawStyle = afDot
- nodx.DrawColor = 255
- nodx.Alignment = afCenterTOP
- nodx.Transparent = True
- nodx.Text = Chr$(13) + Chr$(10) + "INTERNET"
- Set nodx = .Nodes.Add(240, 150, 3525, 3105)
- nodx.ForeColor = 255
- nodx.DrawColor = 255
- nodx.DrawStyle = afDot
- nodx.Alignment = afCenterTOP
- nodx.Transparent = True
- nodx.Text = Chr$(13) + Chr$(10) + "INTRANET"
-
- Set nodx = .Nodes.Add(540, 1935, 2970, 45) 'LAN
- nodx.Shape = afRectangle
- nodx.FillColor = 0
- Set nodx = .Nodes.Add(3060, 2115, 240, 255) 'Router
- nodx.Shape = afWestTriangle
- nodx.FillColor = 0
- Set nodx = .Nodes.Add(5025, 2100, 240, 240) 'Router
- nodx.Shape = afEastTriangle
- nodx.FillColor = 0
- Set nodx = .Nodes.Add(690, 675, 640, 945) 'Server
- nodx.FillColor = 16777215
- nodx.DrawStyle = afTransparent
- nodx.Alignment = afCenterTOP
- nodx.Shape = afRectangle
- nodx.Transparent = True
- nodx.Text = "Server NT"
- Set nodx.Picture = Picture1(3).Picture
- Set nodx = .Nodes.Add(1710, 1155, 480, 480) 'PC client
- nodx.FillColor = 16777215
- nodx.DrawStyle = afTransparent
- nodx.Shape = 1
- nodx.Transparent = True
- Set nodx.Picture = Picture1(1).Picture
- Set nodx = .Nodes.Add(1245, 2340, 480, 465)
- nodx.FillColor = 16777215
- nodx.DrawStyle = afTransparent
- nodx.Shape = 1
- nodx.Transparent = True
- Set nodx.Picture = Picture1(1).Picture
- Set nodx = .Nodes.Add(2175, 2340, 480, 480)
- nodx.FillColor = 16777215
- nodx.DrawStyle = afTransparent
- nodx.Shape = afRectangle
- nodx.Transparent = True
- Set nodx.Picture = Picture1(2).Picture
- Set nodx = .Nodes.Add(1920, 1905, 60, 60)
- nodx.FillColor = 0
- nodx.Shape = afRectangle
- Set nodx = .Nodes.Add(2385, 1935, 60, 60)
- nodx.FillColor = 0
- nodx.Shape = afRectangle
- Set nodx = .Nodes.Add(1440, 1935, 60, 60)
- nodx.FillColor = 0
- nodx.Shape = afRectangle
- Set nodx = .Nodes.Add(3165, 1950, 60, 60)
- nodx.FillColor = 0
- nodx.Shape = afRectangle
- Set nodx = .Nodes.Add(960, 1905, 60, 60)
- nodx.FillColor = 0
- nodx.Shape = afRectangle
- Set nodx = .Nodes.Add(5790, 750, 480, 375)
- nodx.FillColor = 8454143
- Set nodx = .Nodes.Add(5805, 1995, 480, 390)
- nodx.FillColor = 8454143
- Set nodx = .Nodes.Add(5130, 2475, 435, 455)
- nodx.FillColor = 8454143
- Set nodx = .Nodes.Add(6570, 885, 360, 390)
- nodx.Transparent = True
- nodx.DrawStyle = afTransparent
- nodx.Text = "..."
- Set nodx = .Nodes.Add(6585, 1605, 360, 390)
- nodx.Transparent = True
- nodx.DrawStyle = afTransparent
- nodx.Text = "..."
- Set nodx = .Nodes.Add(4620, 1290, 990, 585)
- nodx.FillColor = 8454143
- nodx.Text = "Internet provider"
- ' Set owners by creating rigid links
- .Rigid = True
- .Hidden = True
- ' The five little black boxes are owned by the "LAN" node
- Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(10))
- lnkx.Selectable = False
- Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(11))
- lnkx.Selectable = False
- Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(12))
- lnkx.Selectable = False
- Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(13))
- lnkx.Selectable = False
- Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(14))
- lnkx.Selectable = False
- ' All other nodes inside the INTRANET node are owned by this node
- Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(3))
- lnkx.Selectable = False
- Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(4))
- lnkx.Selectable = False
- Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(6))
- lnkx.Selectable = False
- Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(7))
- lnkx.Selectable = False
- Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(8))
- lnkx.Selectable = False
- Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(9))
- lnkx.Selectable = False
- ' All nodes inside the INTERNET node are owned by this node
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(20))
- lnkx.Selectable = False
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(19))
- lnkx.Selectable = False
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(18))
- lnkx.Selectable = False
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(17))
- lnkx.Selectable = False
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(16))
- lnkx.Selectable = False
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(15))
- lnkx.Selectable = False
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(5))
- lnkx.Selectable = False
- ' Create true visible links.
- .Hidden = False
- .Rigid = False
- ' - the link between intranet and internet
- Set lnkx = .Nodes(5).OutLinks.Add(.Nodes(4))
- lnkx.DrawWidth = 2
- ' - the other links
- .DrawColor = RGB(0, 255, 0)
- Set lnkx = .Nodes(7).OutLinks.Add(.Nodes(10))
- Set lnkx = .Nodes(9).OutLinks.Add(.Nodes(11))
- Set lnkx = .Nodes(8).OutLinks.Add(.Nodes(12))
- Set lnkx = .Nodes(4).OutLinks.Add(.Nodes(13))
- Set lnkx = .Nodes(5).OutLinks.Add(.Nodes(20))
- Set lnkx = .Nodes(20).OutLinks.Add(.Nodes(15))
- Set lnkx = .Nodes(16).OutLinks.Add(.Nodes(20))
- Set lnkx = .Nodes(16).OutLinks.Add(.Nodes(15))
- Set lnkx = .Nodes(16).OutLinks.Add(.Nodes(17))
- Set lnkx = .Nodes(15).OutLinks.Add(.Nodes(18))
- Set lnkx = .Nodes(16).OutLinks.Add(.Nodes(19))
- Set lnkx = .Nodes(6).OutLinks.Add(.Nodes(14))
- .Repaint = True
- End With
- End Sub
- Private Sub Form_Resize()
- If WindowState <> 1 And ScaleHeight <> 0 Then
- AddFlow1.Height = ScaleHeight
- AddFlow1.Width = ScaleWidth
- End If
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- frmMain.ShowExample(1).Enabled = True
- End Sub
-